<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://www.webapp.com.vn/tags" prefix="web" %>

<script type="text/javascript">


</script>

<body>
	<strong style="color: red; font-weight: bold"><s:property value="errorMessage"/></strong>
	<form action="listCustomer" id="frmListCustomer" method="post">
		<s:hidden name="orderColumn" id="orderColumn"/>
		<s:hidden name="pagingInfo.indexPage" id="pagingInfo.indexPage" value="1"/>
		<s:hidden name="pagingInfo.offset" id="pagingInfo.offset" value="10"/>
		<table cellspacing="2" cellpadding="2" border="0" width="100%">
			<tbody>
				<tr>
					<td colspan="5" align="left" valign="top">
						<label>
							<input type="text" size="30" id="frmListCustomer_emailAddress" name="customerInfo.emailAddress"
								value="${customerInfo.emailAddress}"/>
							<input type="submit" value="Search" id="cmdSearch" name="cmdSearch"/>
							<br> ${pagingInfo.total} players matched your search.</label>
					</td>
				</tr>
				
				<tr>
					<td colspan="4" style="border-top: thin solid #666;">&nbsp;</td>
					<td><web:showPaging usingURLForNav="false" navAction="_goTo" pagingInfo="${pagingInfo}" formId="frmListCustomer" /></td>
				</tr>
				
				<s:iterator value="customerInfoList" status="status">
					<tr>
						<td align="left" width="60" valign="top">
							<a href="<s:url value="/account/viewProfile"/>${customerId}">
								<img alt="" width="60" height="60" src="<s:text name="address.resource.images"/>${displayImage}"/></a>
						</td>
						<td width="5">&nbsp;							
						</td>
						<td align="left" valign="top">
							<a href="<s:url value="/account/viewProfile"/>${customerId}">
								<s:property value="displayName"/></a>
						</td>
						<td align="right" width="110" valign="top">
							<label>
								<s:if test="%{friendFlg != 1}">
									<s:if test="%{friendFlg == 0}">
										Request sent!
									</s:if>
									<s:else>
										<input type="button" value="ADD FRIEND" id="frmListCustomer_${customerId}" 
											onclick="javascript:addFriend('${customerId}');">
									</s:else>
								</s:if>
							</label> 
							<br> Bets created (${accountStatusInfo.betsCreatedCount})<br>
							 	 Bets joined (${accountStatusInfo.betsJoinedCount})<br>
								 Friends (${accountStatusInfo.friendCount})
						</td>
					</tr>
					<tr>
				      	<td height="10" style="border-top:thin solid #CCC;" colspan="4"></td>
					</tr>
				</s:iterator>
			</tbody>
		</table>
	</form>
</body>